<button type="button" class="btn btn-primary" data-toggle="modal"
        data-target="#add">写文章
</button>
<div class="text-center">
    <table class="table">
        <thead>
        <tr>
            <th>主题</th>
            <th>详细描述</th>
            <th>解答</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="row in articleList">
            <td>{{row.title}}</td>
            <td>{{row.detail}}</td>
            <td>{{row.answer}}</td>
            <td>{{row.createTime}}</td>
            <td>
                <button type="button" class="btn btn-primary"
                        data-toggle="modal" data-target="#update"
                        ng-click="transferValue(row,$index)">修改
                </button>
                <button type="button" class="btn btn-primary" data-toggle="modal"
                        data-target="#delete" ng-click="transferValue(row,$index)">
                    删除
                </button>
            </td>
        </tr>
        </tbody>
    </table>
</div>
<div class="modal fade" id="add">
    <div class="modal-dialog">
        <div class="modal-content">

            <!-- 模态框头部 -->
            <div class="modal-header">
                <h4 class="modal-title">文章</h4>
                <button type="button" class="close" data-dismiss="modal">&times;</button>
            </div>

            <!-- 模态框主体 -->
            <div class="modal-body">
                <div class="form-group">
                    <label for="title">标题:</label> <input type="text"
                                                          class="form-control" ng-model="model.title" id="title"
                                                          placeholder="输入标题">
                </div>
                <div class="form-group">
                    <label for="detail">详细描述:</label>
                    <textarea class="form-control" rows="1" id="detail"
                              ng-model="model.detail" placeholder="详细描述"></textarea>
                </div>

                <div class="form-group">
                    <label for="answer">解答:</label>
                    <textarea class="form-control" rows="1" id="answer"
                              ng-model="model.answer" placeholder="解答"></textarea>
                </div>
            </div>

            <!-- 模态框底部 -->
            <div class="modal-footer">
                <button ng-click="addArticle()" type="button"
                        class="btn btn-secondary" data-dismiss="modal">确定
                </button>
                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
            </div>

        </div>
    </div>
</div>
